package routers

import (
	"github.com/dheisomgomes/codeapi/controllers"
	"github.com/gin-gonic/gin"
)

func ConfigRouters(s *gin.Engine) *gin.Engine {
	main := s.Group("/api/v1")
	{
		codes := main.Group("codes")
		{
			codes.POST("/", controllers.Insert)
			codes.GET("/", controllers.ShowAll)
			codes.GET("/:id", controllers.Show)
			codes.DELETE("/:id", controllers.Delete)
			codes.PUT("/:id", controllers.Update)
		}
	}
	return s
}
